import java.io.*;
import java.net.*;
public class Client{
	public static void main(String args[]){
	String [] mess = {"2010世界杯在哪举行？","巴西进入世界杯了么？","中国进入世界杯了么？"};
	Socket mysocket;
	DataInputStream in = null;
	DataOutputStream out = null;
	try{ mysocket= new Socket ("10.43.11.101",2010);
	in = new DataInputStream(mysocket.getInputStream());
	out = new DataOutputStream(mysocket.getOutputStream());	
	for(int i=0;i<mess.length;i++){
		out.writeUTF(mess[i]);
		String s = in.readUTF();
		System.out.println("客户收到服务器的回答："+s);
		Thread.sleep(500);
	}
	}
	catch(Exception e){
		System.out.println("服务器已断开"+e);
		}
	}
}
